home *** CD-ROM | disk | FTP | other *** search
Wrap
/* v1.83 PrimaryColors Marko Seppänen marko.seppanen@wwnet.fi */ address IMAGEENGINEER Options results signal on error /* Setup a place for errors to go */ if arg()=0 then exit x=arg(1) parse var x pic pcolor contr . MARK pic PRIMARY PROJECT_INFO pic TYPE info=result if info~='COLOUR' then do CONVERT_TO_COLOUR pic x0=RESULT end else do CONVERT_TO_GREY pic tmp=result CONVERT_TO_COLOUR tmp x0=result CLOSE tmp end if pcolor~=="" then do if upper(pcolor)=="RANDOM" then do x = random(1,12,time('S')) if x="1" then 'COLOUR_FILTER' x0 'RGB 255 0 0 0 0 0' if x="2" then 'COLOUR_FILTER' x0 'RGB 255 0 255 0 0 0' if x="3" then 'COLOUR_FILTER' x0 'RGB 0 0 255 0 0 0' if x="4" then 'COLOUR_FILTER' x0 'RGB 0 0 255 0 255 0' if x="5" then 'COLOUR_FILTER' x0 'RGB 0 0 0 0 255 0' if x="6" then 'COLOUR_FILTER' x0 'RGB 255 0 0 0 255 0' if x="7" then 'COLOUR_FILTER' x0 'RGB 40 0 100 0 255 0' if x="8" then 'COLOUR_FILTER' x0 'RGB 40 0 100 0 0 0' if x="9" then 'COLOUR_FILTER' x0 'RGB 255 0 125 0 0 0' if x="10" then 'COLOUR_FILTER' x0 'RGB 100 0 0 0 0 0' if x="11" then 'COLOUR_FILTER' x0 'RGB 255 0 0 0 -128 0' if x="12" then 'COLOUR_FILTER' x0 'RGB 255 0 200 0 255 0' end end else do if exists("ie:prefs/veprimarycolors.cfg") == "1" then do call open("temp","ie:prefs/veprimarycolors.cfg","R") values=readln("temp") parse var values ok color contr . call close("temp") end else do color=0 contr=1 end 'FORM "Primary Colors" "Use|Cancel"', 'CYCLE,"Choose color","DRed|Yellow|Green|LBlue|DBlue|Violet|Blue|DGreen|Brown|Red|Orange|Pink",'color'', 'CHECKBOX,"Contrast Stretch",'contr'' values=result parse var values ok color contr . if ok = 0 then exit call open("temp","ie:prefs/veprimarycolors.cfg","W") res=writeln("temp",values) call close("temp") end if upper(pcolor)~=="RANDOM" then do select when color == "0" | pcolor == "0" | upper(pcolor) == "DRED" then 'COLOUR_FILTER' x0 'RGB 255 0 0 0 0 0' when color == "1" | pcolor == "1" | upper(pcolor) == "YELLOW" then 'COLOUR_FILTER' x0 'RGB 255 0 255 0 0 0' when color == "2" | pcolor == "2" | upper(pcolor) == "GREEN" then 'COLOUR_FILTER' x0 'RGB 0 0 255 0 0 0' when color == "3" | pcolor == "3" | upper(pcolor) == "LBLUE" then 'COLOUR_FILTER' x0 'RGB 0 0 255 0 255 0' when color == "4" | pcolor == "4" | upper(pcolor) == "DBLUE" then 'COLOUR_FILTER' x0 'RGB 0 0 0 0 255 0' when color == "5" | pcolor == "5" | upper(pcolor) == "VIOLET" then 'COLOUR_FILTER' x0 'RGB 255 0 0 0 255 0' when color == "6" | pcolor == "6" | upper(pcolor) == "BLUE" then 'COLOUR_FILTER' x0 'RGB 40 0 100 0 255 0' when color == "7" | pcolor == "7" | upper(pcolor) == "DGREEN" then 'COLOUR_FILTER' x0 'RGB 40 0 100 0 0 0' when color == "8" | pcolor == "8" | upper(pcolor) == "BROWN" then 'COLOUR_FILTER' x0 'RGB 255 0 125 0 0 0' when color == "9" | pcolor == "9" | upper(pcolor) == "RED" then 'COLOUR_FILTER' x0 'RGB 100 0 0 0 0 0' when color == "10" | pcolor == "10" | upper(pcolor) == "ORANGE" then 'COLOUR_FILTER' x0 'RGB 255 0 0 0 -128 0' when color == "11" | pcolor == "11" | upper(pcolor) == "PINK" then 'COLOUR_FILTER' x0 'RGB 255 0 200 0 255 0' otherwise BRIGHTNESS x0 "-255" end end col=result CLOSE x0 if contr == "1" then CALL Contr col exit Contr: x1=arg(1) CONTRAST_STRETCH x1 x2=result CLOSE x1 CONTRAST x2 20 CLOSE x2 Return exit /*******************************************************************/ /* This is where control goes when an error code is returned by IE */ /* It puts up a message saying what happened and on which line */ /*******************************************************************/ error: if RC=5 then do /* Did the user just cancel us? */ IE_TO_FRONT LAST_ERROR 'REQUEST "'||RESULT||'"' exit end else do IE_TO_FRONT LAST_ERROR 'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!' exit end